package GameItem.Tank
{
	import GameItem.AItmeDisplay;
	
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.Loader;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.net.URLRequest;
	
	public class TankDisplay extends AItmeDisplay
	{
		public function TankDisplay()
		{
			//TODO: implement function
			super();
			loadPicture();
		}
		private function loadPicture():void
		{
			
			var loader:Loader=new Loader();
			var request:URLRequest=new URLRequest("Resources\\p1tankU.gif");
			loader.load(request);
			loader.contentLoaderInfo.addEventListener(Event.COMPLETE,onComplete);
		}
		private function onComplete(evt:Event):void
		{
			var _loader:Loader=evt.target.loader as Loader;
			var _imageData:BitmapData=new BitmapData(_loader.width,_loader.height);
			trace(_loader.width+"  "+_loader.height);
			
			_imageData.draw(_loader); 
			var bmp:Bitmap=new Bitmap(_imageData);
			m_displayContain.addChild(bmp);
		}
		
	}
}